package com.fr.report.io;

import com.fr.report.ResultWorkBook;
import com.fr.report.TemplateWorkBook;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public class ZipTemplateExporter extends AbstractEmbExporter
{
  public static final String ZIP_ENTRY_NAME = "finereport_cpt";

  public void export(OutputStream paramOutputStream, ResultWorkBook paramResultWorkBook)
    throws Exception
  {
    new TemplateExporter().export(toZip(paramOutputStream), paramResultWorkBook);
  }

  public void export(OutputStream paramOutputStream, TemplateWorkBook paramTemplateWorkBook)
    throws Exception
  {
    new TemplateExporter().export(toZip(paramOutputStream), paramTemplateWorkBook);
  }

  private ZipOutputStream toZip(OutputStream paramOutputStream)
    throws Exception
  {
    ZipOutputStream localZipOutputStream = new ZipOutputStream(paramOutputStream);
    ZipEntry localZipEntry = new ZipEntry("finereport_cpt");
    localZipOutputStream.putNextEntry(localZipEntry);
    return localZipOutputStream;
  }
}